<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/finance/djlc/cw_djlc_analyze.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/finance/djlc/cw_djlc_analyze.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'cw_djlc_djzb_id',
                footer: "Foots",
                cnName: '产品定价差异分析',
                name: 'djlc/cw_djlc_analyze',
                url: "/cw_djlc_analyze/",
                sortName: "oldprice,newprice,analyzeprice"
            });
            const editFormFields = ref({});
            const editFormOptions = ref([]);
            const searchFormFields = ref({"oldcomponentnum":"","olddescription":"","newcomponentnum":"","newdescription":"","groupnumname":"","analyzeprice":[null,null]});
            const searchFormOptions = ref([[{"title":"对标物料子件编号","field":"oldcomponentnum"},{"title":"对标子件物料描述","field":"olddescription"}],[{"title":"需求物料子件编号","field":"newcomponentnum"},{"title":"需求物料子件描述","field":"newdescription"}],[{"title":"差异价格","field":"analyzeprice","type":"range"},{"dataKey":"产品定价分组规则","data":[],"title":"组号名称","field":"groupnumname","type":"select"}]]);
            const columns = ref([{field:'oldcomponentnum',title:'对标物料子件编号',type:'string',width:130,align:'left',sort:true},
                       {field:'olddescription',title:'对标子件物料描述',type:'string',width:220,align:'left'},
                       {field:'oldprice',title:'价格',type:'decimal',width:80,align:'left'},
                       {field:'newcomponentnum',title:'需求物料子件编号',type:'string',width:130,align:'left'},
                       {field:'newdescription',title:'需求物料子件描述',type:'string',width:220,align:'left'},
                       {field:'newprice',title:'价格',type:'decimal',width:80,align:'left'},
                       {field:'analyzeprice',title:'差异价格',type:'decimal',width:110,align:'left'},
                       {field:'groupnumname',title:'组号名称',type:'string',bind:{ key:'产品定价分组规则',data:[]},width:120,align:'left'},
                       {field:'groupnum',title:'组号',type:'string',width:120,align:'left'},
                       {field:'cw_djlc_code',title:'定价流程编号',type:'string',width:220,hidden:true,align:'left'},
                       {field:'oldparent_componentnum',title:'对标物料子件父类',type:'string',width:220,hidden:true,align:'left'},
                       {field:'newparent_componentnum',title:'需求物料子件父类',type:'string',width:220,hidden:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
